Skip to content

Feature/rdk 60236 structure#192

Open
Abhinavpv28 wants to merge 92 commits intodevelopfrom
feature/RDK-60236_structure
Open

Feature/rdk 60236 structure#192
Abhinavpv28 wants to merge 92 commits intodevelopfrom
feature/RDK-60236_structure

Conversation

@Abhinavpv28
Copy link
Copy Markdown
Contributor

No description provided.

@Abhinavpv28
Copy link
Copy Markdown
Contributor Author

@copilot
after our changes to add uuid suffix, the file is uploading, asper the logs. in the analytics portal i can see the file. but always hrowing download failed

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Code Coverage Summary

                               Total:|84.1%   6183|97.3%  1644|    -      0

…ectly

rrd_logproc_convert_issue_type() was converting '-' to '_', turning the
suffix '_Search-67768-67' into '_SEARCH_67768_67'. This added extra '_'
separators into the archive filename that broke the analytics portal's
filename parser — it could no longer identify the timestamp field, so
download requests used an incorrect S3 key.

Fix: keep '-' as '-' in the sanitized output. The archive filename now
uses '_' to separate structural fields (MAC, issueType, timestamp) and
'-' within the UUID suffix, giving the portal a reliable delimiter.

Also increase issue_type_sanitized buffer in uploadRRDLogs.c from 64 to
256 bytes so a full UUID suffix never causes a silent truncation failure.

Before: 04B86A12F9F8_DEVICE_DEVICEIP_SEARCH_67768_67_<timestamp>_RRD_DEBUG_LOGS.tgz
After:  04B86A12F9F8_DEVICE_DEVICEIP_SEARCH-67768-67_<timestamp>_RRD_DEBUG_LOGS.tgz

All 331 tests pass.

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/981b6bc1-c9d2-4150-9e9d-851004942ffc

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 6, 2026 06:20
@Abhinavpv28 Abhinavpv28 review requested due to automatic review settings May 6, 2026 06:20
@Abhinavpv28
Copy link
Copy Markdown
Contributor Author

@copilot dont need to check for "_Search-"/"LogSearch-" these strings in the suffix

add one check if the suffix length is more than 9 dont allow

…9 rule

split_issue_type() now discards any suffix whose total length (including
the leading '_') exceeds 9 characters.  The old _Search-/_LogSearch-
prefix validation is removed entirely.

Rule:
  strlen(underscore) <= 9  → suffix accepted
  strlen(underscore)  > 9  → suffix discarded

This means:
  - Short session tokens (e.g. "_ab12345", 8 chars) are carried through
  - Long UUID-based suffixes like "_Search-b6877385-...) are discarded,
    preventing extra '_' delimiters from breaking the portal filename parser

Affected tests updated:
  - UnderscoreSplitsBaseAndSuffix : uses a short accepted suffix
  - MultipleUnderscoresSplitsAtFirst: "_def_ghi" (8 chars) now kept
  - BaseTruncatedWhenTooSmall / ExactFitBase: "_suffix" (7 chars) now kept
  - SuffixTruncatedWhenTooSmall: uses 9-char suffix with 5-byte buffer
  - OnlyUnderscoreInput: "_" (1 char) now kept
  - LogSearchSuffixIsValid → NineCharSuffixIsAccepted (boundary test)
  - SearchSuffixIsValid → LongSuffixIsDiscarded
  - InvalidSuffixPrefixDiscarded / SearchWithoutHyphenIsInvalid /
    LogSearchWithoutHyphenIsInvalid: updated comments (same outcomes)
  - ProcessIssueTypeEvntTest comments updated to reflect new rule

All 331 tests pass.

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/c6d6fc29-da2a-46af-a417-c2de67a18448

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 6, 2026 15:21
@Abhinavpv28 Abhinavpv28 review requested due to automatic review settings May 6, 2026 15:21
…tests

- Expand the RRD_MAX_SUFFIX_LEN comment to explain why 9 chars is the limit
- Rename misleading test names that referenced old prefix-based validation:
    InvalidSuffixPrefixDiscarded → SuffixExceedingMaxLengthDiscarded
    SearchWithoutHyphenIsInvalid → SuffixSeventeenCharsDiscarded
    LogSearchWithoutHyphenIsInvalid → SuffixTwentyCharsDiscarded
- LongSuffixIsDiscarded: switch to a neutral _1234567890 example so the
  test does not imply any Search-specific behavior

All 331 tests pass.

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/c6d6fc29-da2a-46af-a417-c2de67a18448

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 6, 2026 15:24
@Abhinavpv28 Abhinavpv28 review requested due to automatic review settings May 6, 2026 15:24
Copy link
Copy Markdown

Copilot AI commented May 6, 2026

@copilot dont need to check for "_Search-"/"LogSearch-" these strings in the suffix

add one check if the suffix length is more than 9 dont allow
...

Done in commits 9bf94a5 and cbf80c0.

split_issue_type() no longer checks for _Search-/_LogSearch- prefixes. The only rule is now:

  • strlen(underscore) <= 9 → suffix accepted
  • strlen(underscore) > 9 → suffix discarded

(The 9-char limit includes the leading _, so the useful content is up to 8 chars.)

Long UUID suffixes like _Search-b6877385-9463-45fc-b19d-a24d77fd0790 (45 chars) are always discarded, preventing extra _ delimiters from breaking the portal's filename parser.

Tests updated: renamed the three old prefix-focused tests to SuffixExceedingMaxLengthDiscarded, SuffixSeventeenCharsDiscarded, SuffixTwentyCharsDiscarded; renamed LogSearchSuffixIsValidNineCharSuffixIsAccepted (boundary test); updated all comments. All 331 tests pass.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Code Coverage Summary

                               Total:|84.1%   6188|97.3%  1648|    -      0

@Abhinavpv28
Copy link
Copy Markdown
Contributor Author

@copilot currently this is the format but if i have o place the suffix after the tme only ?
04B86A12F9F8_DEVICE_DEVICEIP_67768_6_026-05-06-05-42-35AM_RRD_DEBUG_LOGS.tgz

The analytics portal parses archive filenames by splitting on '_'. When
the suffix was embedded in the issue-type field it shifted the timestamp
field position, causing "download failed" errors.

New format:
  {MAC}_{BASE_ISSUE_TYPE}_{TIMESTAMP}_RRD_DEBUG_LOGS.tgz          (no suffix)
  {MAC}_{BASE_ISSUE_TYPE}_{TIMESTAMP}_{SUFFIX}_RRD_DEBUG_LOGS.tgz (with suffix)

Changes:
- rrdJsonParser.c: pass base and suffix separately to uploadDebugoutput
- rrdExecuteScript.h/c: add suffix param; forward through to orchestrator;
  shell-script path appends suffix to issuename for backward compat
- rrd_upload.h / uploadRRDLogs.c: add suffix param; sanitize suffix
  (strip leading '_', uppercase) separately from base issue type
- rrd_archive.h/c: add suffix param to generate_filename; append after
  timestamp when non-empty
- Unit tests: update all call sites; add ArchiveFilenameGenerationWithSuffix,
  ArchiveFilenameGenerationNullOrEmptySuffix, SuffixSanitizationUppercasesToken

All 334 tests pass.

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/2074afbb-4992-454b-a62b-66eefcb3eb7e

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 6, 2026 15:54
@Abhinavpv28 Abhinavpv28 review requested due to automatic review settings May 6, 2026 15:54
Copy link
Copy Markdown

Copilot AI commented May 6, 2026

@copilot currently this is the format but if i have o place the suffix after the tme only ?
04B86A12F9F8_DEVICE_DEVICEIP_67768_6_026-05-06-05-42-35AM_RRD_DEBUG_LOGS.tgz

Done in commit 6a26473. The suffix is now placed after the timestamp:

{MAC}_{BASE_ISSUE_TYPE}_{TIMESTAMP}_{SUFFIX}_RRD_DEBUG_LOGS.tgz

Example:

04B86A12F9F8_DEVICE_DEVICEIP_2026-05-06-05-42-35AM_AB12345_RRD_DEBUG_LOGS.tgz

The suffix is threaded as a separate parameter through the call chain (uploadDebugoutputrrd_upload_orchestraterrd_archive_generate_filename) so the base issue type field never contains _ from the suffix, keeping the portal's _-based filename parser working correctly. When there is no suffix the format is unchanged.

@copilot dont need to check for "_Search-"/"LogSearch-" these strings in the suffix

add one check if the suffix length is more than 9 dont allow
...

Done in commits 9bf94a5 and cbf80c0. The _Search-/_LogSearch- prefix check is removed. The only rule now is:

  • strlen(suffix_including_underscore) <= 9 → suffix accepted (e.g., _ab12345 = 8 chars ✅)
  • strlen(suffix_including_underscore) > 9 → suffix discarded

Long UUID-style suffixes like _Search-b6877385-… (45 chars) are always discarded.

Copilot AI review requested due to automatic review settings May 6, 2026 15:55
@Abhinavpv28 Abhinavpv28 review requested due to automatic review settings May 6, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants